home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / newconf / depends.mk < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.1 KB  |  39 lines

  1. #------------
  2. #
  3. # compilation rules for generation of dependencies
  4. #
  5. # - needs the variables 
  6. #   CFLAGS, DFLAGS
  7. #   to be correctly set in the main-body makefile {postgres,support}.mk
  8. #
  9. # $Header: /private/postgres/newconf/RCS/depends.mk,v 1.1 1990/08/03 15:23:01 cimarron Exp $
  10. #------------
  11.  
  12. .SUFFIXES: .lex .c .d
  13. .c.d:
  14.     @ echo collecting dependencies for $< | /bin/sed -e 's:$(OD)/::' ; \
  15.     trap 'rm -f `basename $(<F) .c`.d; exit' 2 ; \
  16.     /bin/cc -M $(CFLAGS) $(DFLAGS) -c $< | \
  17.     sort -u | \
  18.     /bin/sed -e 's:^:$(<D)/:' \
  19.          -e 's:$(SD)/:$$(SD)/:g' \
  20.          -e 's:$(OD)/:$$(OD)/:g' > $(@D)/`basename $(<F) .c`.d
  21.  
  22. .lex.d:
  23.     @- echo lexing $(<F) ; \
  24.     trap 'rm -f lex.yy.c `basename $(<F)`.c' `basename $(<F)`.d' 2 ; \
  25.     cd $(@D) ; lex $(<F) ; \
  26.     if [ -f lex.sed ] ; then \
  27.         echo "sed'ing lex.yy.c" ; \
  28.         /bin/sed -f lex.sed < lex.yy.c > `basename $(<F) .lex`.c; \
  29.     else \
  30.         mv lex.yy.c `basename $(<F) .lex`.c ; \
  31.     fi ; \
  32.     /bin/cc -M $(CFLAGS) $(DFLAGS) -c `basename $(<F) .lex`.c ; \
  33.     sort -u | \
  34.     /bin/sed -e 's:^:$(<D)/:' \
  35.          -e 's:$(SD)/:$$(SD)/:g' \
  36.          -e 's:$(OD)/:$$(OD)/:g' > `basename $(<F) .lex`.d ; \
  37.     rm -f `basename $(<F) .lex`.c 
  38.     
  39.